'use strict'

import React from "react";
import ReactDom from "react-dom";
import "./search.css";
import "../../common";
import {a} from './tree-shaking';
import logo from "./image/logo.jpg";
class Search extends React.Component {
  constructor(){
    super(...arguments);
    this.state = {
      Text: null
    }
  }

  loadComponent() {
    import("./text").then((Text) => {
      this.setState({
        Text: Text.default
      })
    });
  }

  render() {
    const {Text} = this.state;
  return <div className="search-text">{Text?<Text></Text>:null}{a()}搜索文字的内容是什么<img src={ logo } onClick={this.loadComponent.bind(this)}></img></div>
  }
}

ReactDom.render(
  <Search></Search>,
  document.getElementById('root')
)